package lab02.test11;

public class square extends Rectangle {
    float side;
    double getDiagonal() {
        return Math.sqrt(side * side + side * side);
    }


     float getArea() {
        return side * side;
    }

     float getPerimeter() {
        return 4 * side;
    }

     void printMyMay() {
        System.out.println("边长:" + side);
        System.out.println("面积:" + getArea());
        System.out.println("周长:" + getPerimeter());
        System.out.println("对角线:" + getDiagonal());
    }
}


